package com.wyh.rabbitmqopsdemo.Controller;


import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/producer")
public class ProducerController {
    @Autowired
    RabbitTemplate rabbitTemplate;

    @RequestMapping("ops")
    public String ops(){
        rabbitTemplate.convertAndSend("","ops.queue","ops test......");
        return "消息发生成功";
    }
}
